<template>
	<view class="all" :style="{ 'padding-top': statusBarHeight + 'px' }">
		<!-- 顶部导航 开始 -->
		<uni-nav-bar left-icon="back" title="消息中心" backgroundColor="#EE515A" color="#ffffff" @clickLeft="handleBack"></uni-nav-bar>
		<!-- 顶部导航 结束 -->
		
		<view class='dynamicBox' style="background-color: #F0F0F0;">
			<!-- 消息开始 -->
			<view class="info_list" v-for="(item,index) in list" :key="index" style="background-color: #FFFFFF;">
				<view class="color_A8AFC2 title" style="color: #333333;" @click="details(item.id)">{{item.title}}</view>
				<view class="color_A8AFC2 text" style="color: #999999;" @click="details(item.id)">{{item.brief}}</view>
				<view class="color_A8AFC2 margin-top-sm" style="color: #999999;">{{item.atime}}</view>
			</view>
			<!-- 消息结束 -->
		</view>
		
	</view>
</template>
<!--
	提示颜色划分：c8266FB cFB6666 c669EFB
-->
<script>
	import searchHead from "@/component/searchHead/searchHead.vue"
	export default {
		components: {
			searchHead,
		},
		data() {
			return {
				statusBarHeight: getApp().globalData.statusBarHeight, //状态栏高度
				list: [],
				tabIndex: 0,
				btnIndex: 0
			};
		},
		methods: {
			//公告列表
			noticeList: function() {
				this.$Request.get(this.$api.index.notice).then(res => {
					this.list = res.data;
				})
			},
			//查看详情
			details: function(id) {
				uni.navigateTo({
					url: '/pages/public/arcticle/detail?type=1&id=' + id
				});
			},
			//返回上一页
			handleBack() {
				uni.navigateBack({
					delta: 1
				});
			},
		},
		onLoad() {
			this.noticeList();
		}
	}
</script>

<style lang="scss" scoped>
	@import "./msg.scss";
</style>
